home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / TestParts / DragText / DragTxPv.h < prev   
Encoding:
C/C++ Source or Header  |  1997-01-01  |  5.5 KB  |  173 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DragTxPv.h
  3.  
  4.     Contains:    Static functions for DragText
  5.  
  6.     Owned by:    Craig Carper
  7.  
  8.     Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <5>     6/28/95    CC        1262618: Added GetFSSpecFromHFSProperty(),
  13.                                     ReadTextFile(), InsertFromTextFile(),
  14.                                     SURemoveValue(), and IsFrontProcess().
  15.          <4>      6/5/95    TJ        Moved the Document Structure from the IDL
  16.                                     file into this one.
  17.          <3>    11/28/94    CC        Checkin of changes to revision 2 noted
  18.                                     below.
  19.          <2+>    11/14/94    CC        Added DrawLinkBorder.
  20.          <2>     9/30/94    CC        1189416 - Utility functions for DragText
  21.                                     'ternalization.
  22.          <1>     9/29/94    RA        first checked in
  23.          <1>      9/8/94    CC        first checked in
  24.  
  25.     To Do:
  26. */
  27.  
  28. #ifndef _DRAGTXPV_
  29. #define _DRAGTXPV_
  30.  
  31. #ifndef _PLFMDEF_
  32. #include "PlfmDef.h"
  33. #endif
  34.  
  35. #ifndef _ALTPOINT_
  36. #include "AltPoint.h"            // Use C++ savvy ODPoint and ODRect
  37. #endif
  38.  
  39. #ifndef __QUICKDRAW__
  40. #include <Quickdraw.h>
  41. #endif
  42.  
  43. #ifndef __TEXTEDIT__
  44. #include <TextEdit.h>
  45. #endif
  46.  
  47. #ifndef __STRING__
  48. #include <String.h>
  49. #endif
  50.  
  51. #ifndef __OSUTILS__
  52. #include <OSUtils.h>    // SysBeep, GetDateTime, etc.
  53. #endif
  54.  
  55. #ifndef __OSEVENTS__
  56. #include <OSEvents.h>
  57. #endif
  58.  
  59. #ifndef __TOOLUTILS__
  60. #include <ToolUtils.h>    // HiWord etc.
  61. #endif
  62.  
  63. #ifndef __SCRAP__
  64. #include <Scrap.h>
  65. #endif
  66.  
  67. #ifndef __LOWMEM__
  68. #include <LowMem.h>
  69. #endif
  70.  
  71. #ifndef __FILES__
  72. #include <Files.h>
  73. #endif
  74.  
  75. #ifndef __QDOFFSCREEN__
  76. #include "QDOffscreen.h"    // for GWorldPtr, StScrpHandle
  77. #endif
  78.  
  79. #ifndef __DIALOGS__
  80. #include "Dialogs.h"
  81. #endif
  82.  
  83. //==============================================================================
  84. // TypeDefs
  85. //==============================================================================
  86.  
  87. typedef struct WindowOffscreen {
  88.     CGrafPtr        windowPort;
  89.     GDHandle        windowDevice;
  90.     GWorldPtr        offscreenWorld;
  91. } WindowOffscreen;
  92.  
  93. //==============================================================================
  94. // Structs
  95. //==============================================================================
  96.  
  97. struct Document
  98. {
  99.     WindowPtr        theWindow;
  100.     TEHandle        theTE;
  101.     ODSShort        docTop;
  102.     RgnHandle        hiliteRgn;
  103.     ControlHandle    vScroll, hScroll;
  104.     ODSShort        vScrollPos;
  105.     ODHandle        undoDragText;
  106.     ODSShort        undoSelStart, undoSelEnd;
  107.     ODSShort        lastSelStart, lastSelEnd;
  108.     ODFrame*           theFrame;
  109.     ODBoolean        frameIsActive, caretShow, cursorInContent, canAccept;
  110.     ODULong            caretTime;
  111.     ODSShort        caretOffset, lastOffset, insertPosition;
  112. };
  113.  
  114.  
  115. //==============================================================================
  116. // Functions
  117. //==============================================================================
  118.  
  119. extern WindowOffscreen *DrawOffscreen(WindowPtr theWindow);
  120. extern void DrawOnscreen(WindowOffscreen *theOffscreen);
  121. extern void DrawCaret(short offset, TEHandle theTE, RgnHandle clipRgn);
  122. extern void InsertTextAtOffset(short offset, char *theBuf, long size, StScrpHandle theStyl, TEHandle theTE);
  123. extern Boolean WhiteSpaceAtOffset(short offset, TEHandle theTE);
  124. extern Boolean WhiteSpace(char theChar);
  125. extern char GetCharAtOffset(short offset, TEHandle theTE);
  126. extern short TEIsFrontOfLine(short offset, TEHandle theTE);
  127. extern short TEGetLine(short offset, TEHandle theTE);
  128. extern pascal void ScrollProc(ControlHandle theControl, short theCode);
  129. extern void AdjustDocumentView(Document *theDocument);
  130. extern ODBoolean ValueOnClipboard(Environment *ev, ODValueType type, ODSession* session);
  131. extern ODBoolean LinkSpecInSU(Environment *ev, ODStorageUnit* su);
  132. extern ODBoolean IncludedInRange(ODSShort start, ODSShort end, ODSShort startRange, ODSShort endRange);
  133. extern ODBoolean RangesOverlap(ODSShort start1, ODSShort end1,ODSShort start2,ODSShort end2);
  134. extern ODBoolean IsKind(ODType type, ODISOStr kind);
  135. extern ODBoolean PasteThisKind(Environment *ev, ODStorageUnit* su, ODType aKind, ODType specifiedKind);
  136. extern char PeekIntoValue(Environment *ev, ODStorageUnit* su, ODValueType kind, ODSLong offset);
  137. extern void TempSelect(ODSShort start, ODSShort end, TEHandle theTE, ODBoolean isActive);
  138. extern ODPoint GetAggregateTranslation(Environment *ev, ODFacet* facet);
  139. extern void CheckMarkMenu(MenuHandle menu, Str255 checkItem, ODBoolean checkIt);
  140. extern ODBoolean OneDragItem(Environment *ev, ODDragItemIterator* dropInfo);
  141. extern ODBoolean SUExistsThenFocus(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
  142. extern void SUForceFocus(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
  143. extern void SUSetValue(Environment* ev, ODStorageUnit* su, ODValue value, ODULong size);
  144. extern void SUFocusAndSetValue(Environment* ev, 
  145.                 ODStorageUnit* su, 
  146.                 ODPropertyName prop, 
  147.                 ODValueType type, 
  148.                 ODValue value, 
  149.                 ODULong size);
  150. extern void SURemoveProperty(Environment* ev, ODStorageUnit* su, ODPropertyName prop);
  151. extern void SURemoveValue(Environment* ev, ODStorageUnit* su, ODPropertyName prop, ODValueType type);
  152. RgnHandle LineBorderFromRange(ODSShort* startOffset, ODSShort endOffset, TEHandle theTEHandle);
  153. extern void DrawLinkBorder(Environment *ev,
  154.                             ODFacet* facet,
  155.                             ODSShort linkStart,
  156.                             ODSShort linkEnd, 
  157.                             TEHandle theTEHandle,
  158.                             LinkBorderStyle borderStyle);
  159.  
  160. pascal Boolean DragTextDialogFilter(DialogPtr dialog,
  161.                             EventRecord* event,
  162.                             short* itemHit);
  163. ODBoolean GetFSSpecFromHFSProperty(Environment* ev,
  164.             ODStorageUnit* su,
  165.             FSSpec* fileSpec);
  166. extern ODHandle ReadTextFile(FSSpec* fileSpec, ODBoolean* truncated);
  167. extern void InsertFromTextFile(FSSpec* fileSpec, TEHandle theTE, ODULong insertPosition);
  168.  
  169. extern ODBoolean IsFrontProcess();
  170.  
  171. #endif // _DRAGTXPV_
  172.  
  173.